import {
    Base
} from '../../utils/base.js';

class User extends Base {
    constructor() {
        super()
    }

    // 获取不同订单数量
    getOrderCount(params, callback) {
        let url = '/ddaigo-platform/order/getOrderCount'
        var reType = 'POST';
        this.commonRequest(url, reType, params, callback);
    }
    //首页-获取导购信息
    getEmploye(params, callback) {
        var url = '/wxserver/index/v1.5/employe';
        var reType = 'POST';

        this.commonRequest(url, reType, params, callback);
    }
    //个人渠道推广数据统计
    channelInfo(params, callback) {
        var url = '/ddaigo-platform/statistics/channelInfoStatistics';
        var reType = 'POST';

        this.commonRequest(url, reType, params, callback);
    }

    //检查用户是否为推广人
    checkChannel(params, callback) {
        var url = '/ddaigo-platform/channel/checkChannelpeople';
        var reType = 'POST';
        this.commonRequest(url, reType, params, callback);
    }

    commonRequest(url, reType, params, callback) {
        var that = this;
        var param = {
            url: url,
            type: reType,
            data: params,
            sCallback: function (data) {
                typeof callback == 'function' && callback(data);
            },
            eCallback: data => {
                callback && callback({
                    status: false
                });
            }
        };
        this.request(param);
    }


}
module.exports = {
    User
}